package com.zyh.alpacaDemo.orderAdaper;


/**
 * @Classname TradingClient
 * @Description TODO()
 * @Date 2025-09-01 21:53
 * @Created by 86177
 */
public class TradingClient {
    public static void main(String[] args) {
        // 切换供应商只需要换这一行
        TradingService tradingService = new AlpacaTradingAdapter();
        // TradingService tradingService = new IBTradingAdapter();

        AdapterOrderRequest request = new AdapterOrderRequest();
        request.setSymbol("AAPL");
        request.setSide("buy");
        request.setType("market");
        request.setTimeInForce("day");

        try {
            AdapterOrderResponse response = tradingService.createOrder(request);
            System.out.println("订单创建成功：" + response.getId());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
